package com.wjc.myktapplication.page.wxaccount

import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.RecyclerView
import com.wjc.basemodule.base.adapter.BasePagingDataBindingAdapter
import com.wjc.myktapplication.R
import com.wjc.myktapplication.data.bean.ArticleBean
import com.wjc.myktapplication.databinding.WxArtItemViewBinding

/**
 * ClassName: com.wjc.myktapplication.page.wxaccount
 * Description:
 * JcChen on 2022.07.28.17:06
 */
class WxArtAdapter : BasePagingDataBindingAdapter<ArticleBean, WxArtItemViewBinding>(object : DiffUtil.ItemCallback<ArticleBean>() {
    override fun areItemsTheSame(oldItem: ArticleBean, newItem: ArticleBean): Boolean {
        return oldItem == newItem
    }

    override fun areContentsTheSame(oldItem: ArticleBean, newItem: ArticleBean): Boolean {
        return oldItem == newItem
    }
}) {
    override fun getLayoutResId(viewType: Int): Int {
        return R.layout.wx_art_item_view
    }

    override fun onBindItem(binding: WxArtItemViewBinding, item: ArticleBean, holder: RecyclerView.ViewHolder) {
       binding.vm = item
        binding.tvRefresh.text = "pos=" + holder.bindingAdapterPosition
    }
}